package com.usian.user.controller.v1;

import com.usian.apis.admin.ApUserRealnameControllerApis;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.user.dtos.AuthDto;
import com.usian.user.constant.UserConstant;
import com.usian.user.service.ApUserRealnameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Auther：DONG on 2021/11/4
 **/
@RestController
@RequestMapping("/api/v1/auth")
public class ApUserRealnameController implements ApUserRealnameControllerApis {

    @Autowired
    private ApUserRealnameService apUserRealnameService;


    @PostMapping("/list")
    @Override
    public ResponseResult loadListByStatus(@RequestBody AuthDto dto) {

        return apUserRealnameService.loadListByStatus(dto);
    }

    @Override
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody AuthDto dto) {

        return apUserRealnameService.authRealName(dto, UserConstant.AUTH_PASS);
    }

    @Override
    @PostMapping("/authFail")
    public ResponseResult authFail(AuthDto dto) {

        return apUserRealnameService.authRealName(dto,UserConstant.AUTH_FAIL);

    }


}
